package cn.justforchris.blog.service;


import cn.justforchris.blog.domain.Article;
import cn.justforchris.blog.dto.ArticleDto;
import cn.justforchris.blog.query.articleQuery;
import cn.justforchris.util.JsonResult;
import com.github.pagehelper.PageInfo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 文章服务接口
 */
public interface IArticleService {
    void insertArticle(Article article);
    void deleteArticle(Long id);
    void patchDelete(Long[] ids);
    void updateArticle(Article article);
    Article getArticleById(Long id);
    List<Article> getAll();


    PageInfo<Article> queryPage(articleQuery queryPage);

    List<ArticleDto> countByArticleType();

    List<ArticleDto> countByDate();

    List<Article> getRelated(Long id);

    List<Article> getarticleByYear(String time);

    List<ArticleDto> countByDateAndYear(String year);

    List<ArticleDto> orderByStar();

    List<ArticleDto> orderByNum();

    void addReadCount(Long id);


    JsonResult updateStar(Long id, HttpServletRequest request);

    JsonResult initIconClass(Long id, HttpServletRequest request);

    List<Article> getArticleByType(Long id);

    List<String> getYears(String year);
}
